<?php

session_start();

$customer_id = $_SESSION['userid'];

include "connect.php";

$customer_name = $_POST['customer_name'];
$customer_email = $_POST['customer_email'];
$customer_number = $_POST['customer_number'];
$contact_message = $_POST['contact_message'];
$today = date("Y,m,d");


	mysql_query("INSERT INTO customer_messages 

	(
	
	message_status,
	customer_name,
	customer_email,
	customer_number,
	contact_message,
	date
		
	) 
	
	VALUES
	
	(
	
	'New',
	'$customer_name',
	'$customer_email',
	'$customer_number',
	'$contact_message',
	'$today')
	
	 "); 

		/////////////////////////
		//Send message as email
		/////////////////////////
		
		$to      = "sean.richardson@hotmail.co.uk";
		$subject = 'Customer message';
			
		$message = "<b>Name:</b> ".$customer_name."<br /><br /><b>Email:</b> ".$customer_email."<br /><br /><b>Number:</b> ".$customer_number."<br /><br />".$contact_message;		
				
		$headers = "From: 24-7Saddles.com <Sales@24-7saddles.com>\r\n";
		$headers .= "MIME-Version: 1.0\r\n";
		$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

		mail($to, $subject, $message, $headers);
		
		/////
		//End
		/////


header('Location: contact_us_landing_page.php?');


?>